import request from '@/router/axios'

// 获取字典信息 分页
export function fetchList(query) {
    return request({
        url: '/sys/dict/getPage1',
        method: 'get',
        params: query
    })
}

export function putObj(obj) {
    return request({
        url: '/sys/dict/',
        method: 'put',
        data: obj
    })
}

export function addObj(obj) {
    return request({
        url: '/sys/dict/add',
        method: 'post',
        data: obj
    })
}

export function getObj(id) {
    return request({
        url: '/admin/dict/' + id,
        method: 'get'
    })
}

export function getDictByType(type) {
    return request({
        url: '/admin/dict/get/cache/' + type,
        method: 'get'
    })
}

export function delObj(row) {
    return request({
        url: '/admin/dict/' + row.id,
        method: 'delete'
    })
}



export function getParentIdsByType(type) {
    return request({
        url: '/admin/dict/getParentIds?type=' + type,
        method: 'get'
    })
}

export function fetchTreeList(query) {
    return request({
        url: '/admin/dict/getTree',
        method: 'get',
        params: query
    })
}
